Skip to content

Conversation

mortenpi
Copy link
Member

@mortenpi mortenpi commented Apr 1, 2025

Shaves about 50% off the basic PkgAuthentication.authenticate("example.com") call (1.1s -> 0.5s on my setup) if you already have the token. Before:

BenchmarkTools.Trial: 5 samples with 1 evaluation per sample.
 Range (min … max):  1.133 s …   1.172 s  ┊ GC (min … max): 0.00% … 0.00%
 Time  (median):     1.155 s              ┊ GC (median):    0.00%
 Time  (mean ± σ):   1.153 s ± 14.355 ms  ┊ GC (mean ± σ):  0.00% ± 0.00%

  █                █             █     █                  █
  █▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█ ▁
  1.13 s         Histogram: frequency by time        1.17 s <

 Memory estimate: 1.33 KiB, allocs estimate: 46.

After:

BenchmarkTools.Trial: 10 samples with 1 evaluation per sample.
 Range (min … max):  516.547 ms … 546.332 ms  ┊ GC (min … max): 0.00% … 0.00%
 Time  (median):     530.276 ms               ┊ GC (median):    0.00%
 Time  (mean ± σ):   531.262 ms ±  12.163 ms  ┊ GC (mean ± σ):  0.00% ± 0.00%

  ▁▁    ▁    ▁          ▁          ▁                ▁   ▁     █  
  ██▁▁▁▁█▁▁▁▁█▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█▁▁▁█▁▁▁▁▁█ ▁
  517 ms           Histogram: frequency by time          546 ms <

 Memory estimate: 1.33 KiB, allocs estimate: 46.

I didn't really check the interactive case, but I don't think it's that important, since it will prompt for user input anyway.

@mortenpi mortenpi requested a review from pfitzseb April 1, 2025 04:26
@mortenpi mortenpi enabled auto-merge (squash) April 7, 2025 05:07
@mortenpi mortenpi merged commit f52ddb2 into master Apr 7, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants